<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>首页-胜院毕设</title>
 <link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="shortcut icon" href="/static/images/logon.ico" />
<link rel="stylesheet" type="text/css" href="/static/css/login.css" />
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
</head>

<body style="background: rgba(52, 54, 66, 0.9);">
<div class="cd-user-modal is-visible"> 
	<div class="cd-user-modal-container">
		<ul class="cd-switcher">
			<li><a href="#0"  style="color:#333;font-size: 20px;">教师登陆</a></li>
			<li><a href="__ROOT__/Home/Index/Student">学生登陆</a></li>
		</ul>
		<div id="cd-signup" class="is-selected"> <!-- 教师登陆 -->
			<form class="cd-form" action="__ROOT__/Home/Login/Teacher" method="post">
				<p class="fieldset">
					<label class="image-replace cd-username" for="signup-username">教师工号</label>
                                        <input  class="full-width has-padding has-border" id="signup-username" name="tea_number" required type="text" placeholder="输入教师工号">
				</p>
				<p class="fieldset">
					<label class="image-replace cd-password" for="signup-password">密码</label>
                                        <input class="full-width has-padding has-border" required id="signup-password"  type="password" name="pwd" placeholder="输入密码">
				</p>

				<p class="fieldset">
					<label class="image-replace " for="signin-password">验证码</label>
                                        <input class="full-width  has-border"  required  type="text" name="code" placeholder="  验证码" style="width: 100px;height: 50px;padding-left: 8px;">
                                        <img src="__ROOT__/Home/Verify" title="验证码" onclick="yan(this)"/> 
                                </p>
                                <p class="fieldset"><a  data-toggle="modal" data-target="#myModal" style="text-decoration: none">忘记密码？找回密码</a></p>
				<!-- <p class="fieldset">
					<input type="checkbox" id="accept-terms">
					<label for="accept-terms">我已阅读并同意 <a href="#0">用户协议</a></label>
				</p> -->
		
				<p class="fieldset">
					<input class="full-width2" type="submit" value="教 师 登 录">
				</p>
			</form>
		</div>
	</div>
</div> 

<!-- 教师（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">教师找回密码</h4>
            </div>
<form class="form-horizontal" role="form" action="{:U('/Home/Login/AlterTeaWd')}" method="post">
            <div class="modal-body">
                <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">账号：</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="tea_number" name="tea_number" placeholder="请输入账号">
                    </div>
                  </div>
                <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">预留的邮箱：</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="tea_email" name="email" placeholder="请输入预留的邮箱">
                    </div>
                  </div>
                <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">新密码：</label>
                    <div class="col-sm-9">
                      <input type="text" name="pwd1" class="form-control" id="firstname" placeholder="请输入新密码">
                    </div>
                  </div>
                <div class="form-group">
                    <label for="firstname" class="col-sm-3 control-label">收到的验证码：</label>
                    <div class="col-sm-3">
                      <input type="text" name="code" class="form-control" id="firstname" placeholder="验证码">
                    </div>
                     <label for="firstname" class="col-sm-3 control-label"><input type="button"  class="btn btn-primary btn-sm" id="tea" value="获取验证码" /></label>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
</body>
<script type="text/javascript">
///刷新验证码
var i = 0;
function yan(t){
    t.src=' __ROOT__/Home/Verify/Index/'+i++;
}
var wait=60;
function time(o) {
  if (wait == 0) {
   o.removeAttribute("disabled");   
   o.value="获取验证码";
   wait = 60;
  } else { 
 
   o.setAttribute("disabled", true);
   o.value="重新发送(" + wait + ")";
   wait--;
   setTimeout(function() {
    time(o)
   },
   1000)
  }
 }
document.getElementById("tea").onclick=function(){
    teather();
    time(this);
};
document.getElementById("stuh").onclick=function(){
    
    student();
    time(this);
};
function teather(){
    //alert(jQuery("#tea_number").val())
    //exit
    if(jQuery("#tea_number").val() == ''){
        alert('请输入账号');
        retrun ;
    }
    if(jQuery("#tea_email").val() == ''){
        alert('请输入邮箱');
        retrun ;
    }
    $.post("{:U('/Home/Login/retrieveTeacher')}",
    {
        tea:jQuery("#tea_number").val(),
        email:jQuery("#tea_email").val()
    },1);
}
function student(){
    //alert(jQuery("#tea_number").val())
    //exit
    
    if(jQuery("#stu_number").val() == ''){
        alert('请输入账号');
        retrun ;
    }
    if(jQuery("#stu_email").val() == ''){
        alert('请输入邮箱');
        retrun ;
    }
    $.post("{:U('/Home/Login/retrieveStudent')}",
    {
        stu:jQuery("#stu_number").val(),
        email:jQuery("#stu_email").val()
    },1);
}
</script>

</html>
